package com.changanw.openfeign;

import com.changanw.api.IUserService;
import com.changanw.commons.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;


//@FeignClient(value = "provider",fallback = HelloServiceFallback.class)
@FeignClient(value = "provider",fallbackFactory = HelloServiceFallbackFactory.class)
public interface HelloService extends IUserService {
   /* @GetMapping("/hello")
    String hello();//这里的方法名称无所谓
    //测试参数的传递开始
    @GetMapping("/hello2")
    String hello2(@RequestParam("name") String name);

    @PostMapping("/user2")
    User addUser(@RequestBody User user);

    @DeleteMapping("/user2/{id}")
    void deleteUser(@PathVariable("id") Integer id);

    @GetMapping("/user3")
    void getuserByName(@RequestHeader("name") String name);
    //测试参数的传递结束*/

}
